package com.heima.admin.controller;

import com.heima.admin.service.IApAuthService;
import com.heima.model.article.dtos.AuthDto;
import com.heima.model.common.dtos.ResponseResult;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/api/v1/auth")
@RequiredArgsConstructor
public class ApAuthController {

    private final IApAuthService apAuthService;

    @PostMapping("/list")
    @ApiOperation("用户审核查询列表")
    public ResponseResult auth(@RequestBody AuthDto authDto){
        System.out.println(authDto);
        return apAuthService.authList(authDto);
    }

    @PostMapping("/authFail")
    @ApiOperation("审核失败")
    public ResponseResult authFail(@RequestBody AuthDto authDto){
        return apAuthService.authFail(authDto);
    }


    @PostMapping("/authPass")
    @ApiOperation("审核成功")
    public ResponseResult authPass(@RequestBody AuthDto authDto){
        return apAuthService.authPass(authDto);
    }

}
